import axios from '@/utils/api'

// 登录校验
const UserLogin = (username, password) => {
    // console.log(username,password);


    return axios.post("http://localhost:3000/login/login", { username, password })
}

// 初始化登录校验
const APPinit = (token) => {
    // console.log(username,password);
    // console.log("token正在校验");
    return axios.post("http://localhost:3000/login/appinit", { token })
}


// 请求用户信息列表
const userlist = (p) => {

    return axios.post("http://localhost:3000/login/userlist", { p })
}

// 修改用户信息
const SetUserInfo = (userobj) => {

    return axios.post("http://localhost:3000/login/updateuser", { ...userobj })
}

// 删除用户

const DelUser = (_id, token) => {

    return axios.post("http://localhost:3000/login/deluser", { _id, token })
}

// 查询用户信息
const searchUser = (SearchCode, msg,p) => {

    return axios.post("http://localhost:3000/login/selectuser", { SearchCode, msg,p })
}

export { UserLogin, APPinit, userlist, SetUserInfo, DelUser, searchUser }